package 素数筛选.质数排列;

import com.sun.security.jgss.GSSUtil;

/**
 * TODO
 *
 * @className: zspl
 * @description: TODO
 * @author: 等什么柠檬君
 * @date: 2022-05-06 17:49
 **/
public class zspl {
    public static void main(String[] args) {
        System.out.println(numPrimeArrangements(100));
    }
    static int mod = (int) 1e9 + 7;
    public static int numPrimeArrangements(int n) {
        int m = 0;
        for (int i = 2; i <= n; i++) {
//            System.out.println("第"+i);
            if (isPrimay(i)){
//                System.out.println(i+"质数");
                ++m;
            }
        }
        System.out.println("countm "+m);
//        int A = jc(n)/(jc((n-m))*jc(m));;
        System.out.println("剩余 "+(n-m));
        long ANZ = jc(n-m) % mod;
        long AZ = jc(m) % mod;
        System.out.println("result ANZ "+(ANZ) );
        System.out.println("result AZ "+(AZ) );
        System.out.println("result  "+(AZ*ANZ) % mod );
        return (int) ((AZ*ANZ) % mod);
    }
    public static long jc(int n){
        long C = 1;
        for (int i = 2; i <= n; i++) {
            C *= i;
            C %= mod;
        }
        return C;
    }
    public static boolean isPrimay(int n){
        for (int i = 2; i <= Math.sqrt(n); ++i) {
            if (n % i == 0){
                return false;
            }
        }
        return true;
    }
}
